-- GENERATED SPELL FOR [Patchwork Golem] --


function spell0_16017(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(27794,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16017', 0, 1)
end

function spell1_16017(pUnit, Event) --@Disease Cloud,Self--
pUnit:FullCastSpellOnTarget(27793,pUnit)
pUnit:RegisterEvent('Sorts_16017', 0, 1)
end

function spell2_16017(pUnit, Event) --@Execute,n/a--
pUnit:FullCastSpellOnTarget(7160,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16017', 0, 1)
end

function spell3_16017(pUnit, Event) --@Execute,n/a--
pUnit:FullCastSpellOnTarget(56426,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16017', 607, 1)
end

function spell4_16017(pUnit, Event) --@War Stomp,Self--
pUnit:FullCastSpellOnTarget(27758,pUnit)
pUnit:RegisterEvent('Sorts_16017', 3000, 1)
end

function spell5_16017(pUnit, Event) --@War Stomp,Self--
pUnit:FullCastSpellOnTarget(56427,pUnit)
pUnit:RegisterEvent('Sorts_16017', 4000, 1)
end

function Sorts_16017(pUnit, Event)
local choix_sorts_16017 = math.random(0, 5)
if choix_sorts_16017 == 0 then
pUnit:RegisterEvent('spell0_16017', 1, 1)
end
if choix_sorts_16017 == 1 then
pUnit:RegisterEvent('spell1_16017', 1, 1)
end
if choix_sorts_16017 == 2 then
pUnit:RegisterEvent('spell2_16017', 1, 1)
end
if choix_sorts_16017 == 3 then
pUnit:RegisterEvent('spell3_16017', 1, 1)
end
if choix_sorts_16017 == 4 then
pUnit:RegisterEvent('spell4_16017', 1, 1)
end
if choix_sorts_16017 == 5 then
pUnit:RegisterEvent('spell5_16017', 1, 1)
end
end

function mob16017_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16017', math.random(1500, 3000), 1)
end

function mob16017_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16017_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16017_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16017, 1, 'mob16017_Action')
RegisterUnitEvent(16017, 2, 'mob16017_Leave')
RegisterUnitEvent(16017, 3, 'mob16017_Kill')
RegisterUnitEvent(16017, 4, 'mob16017_Die')
